package game.particles;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.ParticleEmitter;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;

public abstract class AbsParticle {
	protected ParticleEffect effect;
    protected Array<ParticleEmitter> emitters;
    protected float fpsCounter;
    int emitterIndex;
    int particleCount = 10;
    
    public AbsParticle() {
		
	}
    
	public AbsParticle(String effectFile, String imagesDir) {
		effect = new ParticleEffect();
		effect.load(Gdx.files.internal(effectFile), Gdx.files.internal(imagesDir));
        effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
        emitters = new Array(effect.getEmitters());
        effect.getEmitters().clear();
        for(ParticleEmitter emitter : emitters)
        	effect.getEmitters().add(emitter);
	}
	
	public void update(){
	}
	public void render(SpriteBatch sb){
		
	}
	
	public void start(){
		effect.start();
	}
	
	public void dispose(){
		effect.dispose();
		emitters.reverse();
	}
	public void setPosition(int x, int y){
		effect.setPosition(x, y);
	}
}
